package midway.madness.post.image;

import java.io.IOException;

import midway.madness.post.PostObject;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;

public class PictureObject extends PostObject{
	
	private Bitmap bitmap;
	private String attachments, thumbnailUrl, regularUrl;

	public PictureObject(Context pContext, String pAuthor, String pTitle, String pDate, String pUrl, Bitmap bMap, String pRegularUrl) throws IOException{
		super(pContext, pAuthor, pTitle, pDate);
		thumbnailUrl = pUrl;
		bitmap = bMap;
		regularUrl = pRegularUrl;
	}
	
	public PictureObject(Context pContext, int pId, String pAuthor, String pTitle, String pContent, String pDate, String pSlug, String[] pComments, String pUrl, String pAttachments){
		super(pContext, pId, pAuthor, pTitle, pContent, pDate, pSlug, pComments);
		thumbnailUrl = pUrl;
		attachments = pAttachments;
	}

	@Override
	public void goForIntent() {
		Intent intent = new Intent(getContext(), GalleryActivity.class);
		intent.putExtra("title", getTitle());
		intent.putExtra("author", getAuthor());
		intent.putExtra("date", getDate());
		intent.putExtra("comments", getComments());
		intent.putExtra("html", getContent());
		intent.putExtra("attachments", attachments);
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		getContext().startActivity(intent);
	}
	
	public Bitmap getBitmap() {
		return bitmap;
	}

	public String getAttachments() {
		return attachments;
	}

	public String getThumbnailUrl() {
		return thumbnailUrl;
	}

	public String getRegularUrl() {
		return regularUrl;
	}

}
